package org.geektimes.projects.user.repository;

import org.geekbang.projects.orm.annotation.Param;
import org.geekbang.projects.orm.annotation.Read;
import org.geekbang.projects.orm.annotation.Write;
import org.geektimes.projects.user.domain.User;

import java.util.List;

public interface UserMapper {

	@Write("INSERT INTO users( name,password,email,phone_number) "
			+"VALUES({name},{password},{email},{phoneNumber})")
	int insertUser(User user);


	@Write("UPDATE users SET password = {password} where id = {id}")
	int update(User user);


	@Read("SELECT * FROM users ")
	List<User> queryAll();


	@Read("SELECT * FROM users where id = {id}")
	User get(@Param("id") long id);

}
